package com.w.mapper;

import com.w.domain.Gly;
import com.w.domain.User;
import com.w.domain.WenJian;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
@Mapper
public interface UserMapper {

    /**
     * 查询全部
     * @return
     */
    List<User> selectAllInfos();

    /**
     * 插入一条记录
     * @param user
     * @return
     */
    int insertSelectiveOneInfos(User user);

    /**
     * 查询访问量
     * @return
     */
    Long selectFwl();
    /**
     * 访问量+1
     * @return
     */
    void updataFwl(Long sums);

    /**
     * 删除留言
     * @param ip
     */
    int deleteInfo(String ip);

    /**
     * 管理员登陆
     * @param gly
     * @return
     */
    Gly getCly(Gly gly);

    /**
     * 根据id获取一条新年祝福语句
     * @param id
     * @return
     */
    String getHappyInfo(int id);

    int insertWenjian(WenJian wenJian);

    ArrayList<WenJian> selectAllWenjian(String name);

    int deleteOne(Integer wid);

    WenJian getOneWenjian(Integer wid);
}
